package FRC2856.Robot;

import java.io.*;

public class BufferedReader extends InputStream {

    private InputStream rawStream;

    public BufferedReader(InputStream in) {
        rawStream = in;
    }

    /**
     * See InputStream.read()
     */
    public int read() throws IOException 
    {
        return rawStream.read();
    }

    public String readLine() throws IOException 
    {
        String str = "";
        int in = 0;
        char ch = ' ';

        while ((in = rawStream.read()) != -1 && (ch = (char) in) != '\0' && ch != '\n' && ch != '\r') 
        {
            System.out.print(ch);
            str += ch;
        }
        return str;
    }
}
